home *** CD-ROM | disk | FTP | other *** search
- #define XSIZECM 18 /* at 120 DPI */
- #define YSIZECM 24 /* at 72 DPI */
- #define NXBITS 620
- #define NYBITS 400
-
- #include "bitmap.h"
- dvitype(void)
- {
- printf("Deskjet/Laserjet");
- }
- #include <graphics.h>
- bitmap_print()
- {
- int x,y,z;
- int d_graphmode=0,g_driver=0,g_error;
- double f;
- unsigned char *line;
- printf("press return to enter graphics \n");
- getch();
- detectgraph(&g_driver, &d_graphmode);
- if (g_driver<0) {
- printf("No graphics hardware detected !!!!! \n");
- gle_abort("Could not load BGI graphics\n");
- }
- initgraph(&g_driver,&d_graphmode,"");
- g_error = graphresult();
- if (g_error<0) {
- printf("Init graph error %s\n",grapherrormsg(g_error));
- gle_abort("Init graph error\n");
- }
-
- for (y=0; y<400; y++) {
- line = bitmap_line(nybits-y);
- for (x=0; x<620 ; x++) {
- z = 1 << (x % 8);
- if ((z & line[x/8]) != 0) {
- putpixel(x,y,2);
- }
-
- }
- }
-
- getch();
-
- closegraph();
-
- }
- ljsendline(char *s, int nc,int y)
- {
- pprintf("\x1b&a%.1fh%.1fV",0.0,((NYBITS-y)/150.0)*720.0); /* move xy */
- pprintf("\x1b*b1M"); /* compact */
- pprintf("\x1b*r1A"); /* start graphics at cur pos */
- pprintf("\x1b*b%dW",nc); /* send y bytes */
- printmem(s,nc);
- pprintf("\x1b*rB"); /* end grpahics */
- }
-
-